<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      div{
          width: 400px;
          height: 400px;
          border:1px red solid;
          margin: 100px auto;
      }

    </style>
</head>
<body>

      <div></div>
    
</body>
</html>
<script>
/*
    click: 点击
    dblclick:双击
    onmouseover: 鼠标移入
    onmouseout: 鼠标移出
    onmousedown: 鼠标按钮
    onmouseup: 鼠标抬起
    onmousemove:鼠标移动
     onmouseenter: 鼠标进入
     onmouseLeave:鼠标离开
*/

 let divObj = document.getElementsByTagName('div')[0];
//单击
//  divObj.onclick=()=>{
//     console.log('click');
//  }

//双击
//  divObj.ondblclick=()=>{
//     console.log('dblclick');
//  }

//鼠标移入
// divObj.onmouseover=()=>{
   
//      console.log("over");
//    // divObj.style.backgroundColor='green';
// }
//鼠标移除
// divObj.onmouseout=()=>{
   
//    console.log("out");
// }

//鼠标的按下
divObj.onmousedown=()=>{
   
     console.log("down");
  }
   
  //鼠标的抬起
divObj.onmouseup=()=>{
   
   console.log("up");
}
 


</script>